<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工程签证单审批</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        /*.layui-form-pane .layui-input-block{margin-left: 82px;}*/
        .saixuan:after{width: 0;}
        .layui-form-pane .layui-input-block{margin-left: 0;width: 98%;}
		.layui-table-cell{
			padding: 0;
		}
		.masksx{
			height: 500px;
		}
		.mask .sug{
			width: 300px !important;
			display: inline;
		}
		.layui-input-inline{
			width: 80%;
		}
		li:before {
	   	 content: "";
	    }
        @media screen and (max-width: 1280px) {
            .layui-form-pane .layui-form-label{width: 108px;}

        }

        /*.layui-form-item .layui-input-inline{width: 165px;}*/
       .inline-lists{
       		/*width: 500px;*/
       		text-align: left;
       }
       .inline-lists li{
       		padding: 10px 0;
       }

        .masksx .forms{padding-left: 0;text-align: center;}
        .masksx{width: 650px;}
        .mask input{width: 100%!important;}
        .mask .layui-select-title{width: 480px;}
        .layui-inline{margin-bottom: 10px;}
        .layui-upload{ text-align: left;}
        #demo2 img{width: 120px; height: 120px;}
        .imgs{position: relative;width: 120px; height: 120px; float: left;}
        ._ingshan{position: absolute;right: 0px;top: 0px;border: 1px solid #E3e3e3;
            border-radius: 50%;width: 20px;height: 20px;text-align: center;}
        @media only screen and (min-width: 321px) and (max-width: 1024px) {
            .layui-form-pane .layui-input-inline {width: 98%;}
            ._inkong{ width:auto!important; }
            .layui-form-item .layui-input-inline{width: 98%;}
            .masksx{height: 50%;}
        }
        @media screen and (max-width: 750px){
            .MOVE_queryon .layui-form-item {
                width: 80%;
            }
            .layui-form-item{padding: 0;}
            .MOVE_footer{text-align: right;}
            .MOVE_footer a{color: #FFF;font-size: 20px;line-height: 30px;
                padding: 10px;background-color: #F5A721;height: 100%;position: absolute;right: 0;}
        }



    </style>
</head>
<body>
<div class="_PC">
    <form class="layui-form layui-form-pane" id="form_7grid" action="" >
        <div class="formTop layui-row">
            <div class="layui-form-item layui-col-lg3 layui-col-md3 layui-col-xs6">
                <div class="layui-input-inline">
                    <input type="text" name="mname"  placeholder="项目名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs6">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test-limit3" placeholder="请选择开始日期">
                    <div class="icons">

                    </div>
                </div>
            </div>
            <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs6">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test-limit4" placeholder="请选择结束日期">
                    <div class="icons">

                    </div>
                </div>
            </div>
            <div class="layui-inline layui-col-lg2 layui-col-md2 layui-col-xs6">
                <div class="layui-input-block">
                    <select name="state" lay-filter="aihao">
                        <option value="" selected="">请选择审核状态</option>
                        <option value="0">完成</option>
                        <option value="-1">未完成</option>
                    </select>
                </div>
            </div>
            <div class="layui-col-lg1 layui-col-md1 layui-col-xs12">
                <button class="layui-btn tiaojiao" type="button" onclick="query()" style="float: right; margin-left: 30px;">查询
                </button>
            </div>

        </div>

        <table id="demo" lay-filter="test"></table>

        <div id="demo7"></div>
        <a class="dayin" type="button" id="dlink"  style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>

        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-sm chakan quanxian" lay-event="detail" QX="api/buil/buildSignSpDetails.do">查看</a>
            <a class="layui-btn layui-btn-sm layui-btn-danger shenpi quanxian" lay-event="exam" QX="api/buil/buildSignSp.do">审核</a>
        </script>

        <div class="mask">
            <div class="masksx">
                <div class="title"><span class="titleL">签证审核</span><span class="close">×</span></div>
                <div class="forms">
                    <form class="layui-form addUser" method="post" action="">

                      
                        <div class="layui-inline inline-lists">
                            <ul>
                            	<li>
                            		<span>合同号：</span>
                            		<span class="number"></span>
                            	</li>
                            	<li>
                            		<span>项目名称：</span>
                            		<span class="com-name"></span>
                            	</li>
                            	<li>
                            		<span>签证人：</span>
                            		<span class="people"></span>
                            	</li>
                            	<li>
                            		<span>签证内容：</span>
                            		<span class="people-cont"></span>
                            	</li>
                            	<li>
                            		 <!--<div class="layui-form-item">-->
									   <span>审核意见：</span>
									    <!--<div class="layui-input-block">-->
									      <input type="text" name="title" required  lay-verify="required" autocomplete="off" class="layui-input sug">
									    <!--</div>-->
									  <!--</div>-->
                            	</li>
                            	<li>
                            		
                            		 <!--<div class="layui-form-item">-->
									    <span>审核结果:</span>
									    <!--<div class="layui-input-block">-->
									      <input type="radio" name="s_validate" value="0" title="通过">
									      <input type="radio" name="s_validate" value="1" title="不通过" checked>
									    <!--</div>-->
									  <!--</div>-->
                            	</li>
                            </ul>
                        </div>
                      

                        <div class="_submit">
                            <button class="layui-btn layui-btn-sm tijiao" lay-submit lay-filter="_subm">提交</button>
                            <!--<button class="layui-btn layui-btn-sm " type="reset">重置</button>-->
                        </div>

                    </form>

                </div>
            </div>

        </div>



    </form>
</div>



<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>

<script>
    function query() {
        layui.use(['form', 'layedit', 'laydate','table','element','upload'], function() {
            var form = layui.form
                , table = layui.table
                ,upload = layui.upload;
            var proName=$("[name='mname']").val();      //获取查询值
            var begintime=$('#test-limit3').val();          //获取查询开始时间
            var endtime=$('#test-limit4').val();            //获取查询结束时间
            var state=$('[name="state"]').val();         //获取状态值
            $('#form_7grid').attr('action',urls+'/api/contract/conValiList.do')
            if(!AntiSqlValid(proName)){           //判断是否包含特殊符号
                API.gongchengqianzhengdanshenpi({'mname':proName,'begintime':begintime,'endtime':endtime,'state':state,'p':getCookie('yanzheng')})
            }else {
                layer.msg('请勿输入特殊符号或敏感文字');
            };
        })

    }
    layui.use(['form', 'layedit', 'laydate','table','element','upload','flow'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table=layui.table
            ,element=layui.element
            ,flow=layui.flow
            ,upload = layui.upload;
        var _picurls=new Array();
        jiazais();

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';        //代替另一个对象调用一个方法。call 方法可将一个函数的对象上下文从初始的上下文改变为由 thisObj 指定的新对象。
        });


        //前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
        panduanshijiantow('#test-limit3','#test-limit4',1000,1000,'.tiaojiao');     //查询 开始结束时间判断
        API.gongchengqianzhengdanshenpi({'p':getCookie('yanzheng')});

				$('.close').click(function() { //遮罩层隐藏
					$('.mask').hide();
				})
                dayintishi('.dayin');

				laydate.render({
					elem: '#date'
				});
				var ccuid = '';
				var cc_code;
				var state;
				//监听工具条
				table.on('tool(test)', function(obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
					var data = obj.data; //获得当前行数据
					var layEvent = obj.event; //获得 lay-event 对应的值
					var tr = obj.tr; //获得当前行 tr 的DOM对象

					if(layEvent === 'detail') { //查看
						////console.log(obj)
                        sessionStorage.cs_id=obj.data.cs_id;

						window.location.href = 'gongchengqianzhengdanDetails.html';
					} else if(layEvent === 'exam') { //审核
						////console.log(obj);
						$('.mask').show();
						$(".number").text(obj.data.cc_Code);
						$(".com-name").text(obj.data.eppName+obj.data.eppStaEnd);
						$(".people").text(obj.data.s_Person);
						$(".people-cont").text(obj.data.s_Content);
						cc_code=obj.data.cs_id;
						state= obj.data.state;

					}
				});

				form.on('submit(_subm)', function(data) {
					////console.log(data)

					data.field.cs_id = cc_code;
					data.field.cc_code=cc_code;
//					data.field.s_validate=$('[name="sex"]').val();
					data.field.s_Opinion=$(".sug").val();
					data.field.state= state;
					data.field.p=getCookie('yanzheng');
					formAlertAjax('/api/buil/buildSignSp.do', data.field, '.tijiao');
					////console.log(data.field)

					return false;
				})

       

    })




</script>
</body>
</html>